﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<ProjectDirector.ViewModels.EmployeeViewModel>" %>

<asp:Content ID="registerTitle" ContentPlaceHolderID="TitleContent" runat="server">
    Register
</asp:Content>
<asp:Content ID="registerContent" ContentPlaceHolderID="MainContent" runat="server">  
<table width="100%"><tr><td style="width:55px;">
<img src="../../Content/Images/bigimgs/158.png" width="50px" height="50px" />
</td>
<td>
<span style="font-size:14px; font-weight:bold;">
        Create a New User Account</span>
</td></tr>
</table> 
<hr style="border-width: 1px; color: Black;" />  
    <script src="<%: Url.Content("~/Scripts/jquery.validate.min.js") %>" type="text/javascript"></script>
    <script src="<%: Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js") %>" type="text/javascript"></script>
  
       <% Html.BeginForm(); %>
    <%: Html.ValidationSummary(true, "Account creation was unsuccessful. Please correct the errors and try again.") %>      
    <table width="100%">
        <tr>
            <td style="width: 115px">
                <%: Html.LabelFor(m => m.Employee.TitleId) %>
            </td>
            <td>
                <%: Html.DropDownListFor(m => m.Employee.TitleId, new SelectList(Model.Titles, "TitleId", "TitleName"), new { @class = "SmallTextBox" })%>
            </td>            
            <td rowspan="11" valign="top">
             <table width="100%">
        <tr>
            <td style="width: 163px">
                <%: Html.LabelFor(m => m.Address.Address1) %>
            </td>
            <td>
                <%: Html.TextBoxFor(m => m.Address.Address1, new { @class = "TextBox" })%>
            </td>
        </tr>
        <tr>
            <td style="width: 163px">
                <%: Html.LabelFor(m => m.Address.Address2) %>
            </td>
            <td>
                <%: Html.TextBoxFor(m => m.Address.Address2, new { @class = "TextBox" })%>
            </td>
        </tr>
        <tr>
            <td style="width: 163px">
                <%: Html.LabelFor(m => m.Address.Town) %>
            </td>
            <td>
                <%: Html.TextBoxFor(m => m.Address.Town, new { @class = "TextBox" })%>
            </td>
        </tr>
        <tr>
            <td style="width: 163px">
                <%: Html.LabelFor(m => m.Address.PostalCode) %>
            </td>
            <td>
                <%: Html.TextBoxFor(m => m.Address.PostalCode, new { @class = "SmallTextBox" })%>
            </td>
        </tr>
        <tr>
            <td style="width: 163px">
                <%: Html.LabelFor(m => m.Address.CountryId) %>
            </td>
            <td>
                <%:Html.DropDownListFor(m => m.Address.CountryId, new SelectList(Model.Countries, "CountryId", "CountryName"), new { @class = "TextBox" })%>
            </td>
        </tr>
        <tr>
            <td style="width: 163px">
                <u>Acount Details</u>
            </td>
            <td>
                &nbsp;
            </td>
        </tr>
        <tr>
            <td style="width: 163px">
                <%:Html.LabelFor(m=>m.RegisterModel.UserName) %>
            </td>
            <td>
                <%:Html.TextBoxFor(m=>m.RegisterModel.UserName, new{@class="TextBox"}) %>
            </td>
        </tr>
        <tr>
            <td style="width: 163px">
                <%:Html.LabelFor(m=>m.RegisterModel.Password) %>
            </td>
            <td>
                <%: Html.PasswordFor(m=>m.RegisterModel.Password, new{@class="TextBox"}) %>
            </td>
        </tr>
        <tr>
            <td style="width: 163px" valign="top">
                <%: Html.LabelFor(m => m.RegisterModel.RoleName) %>
            </td>
            <td>
                <%:Html.ListBoxFor(m=>m.RegisterModel.RoleName, new SelectList(Model.MembershipRoles, "RoleName","RoleName"),new {@class="TextBox"}) %>
            </td>
        </tr>
    </table>
            </td>
        </tr>
        <tr>
            <td style="width: 115px">
                <%: Html.LabelFor(m => m.Employee.FirstName) %>
            </td>
            <td>
                <%: Html.TextBoxFor(m=>m.Employee.FirstName, new{@class="TextBox"}) %>
            </td>
        </tr>
        <tr>
            <td style="width: 115px">
                <%: Html.LabelFor(m => m.Employee.LastName) %>
            </td>
            <td>
                <%: Html.TextBoxFor(m=>m.Employee.LastName, new{@class="TextBox"}) %>
            </td>
        </tr>
        <tr>
            <td style="width: 115px">
                <%: Html.LabelFor(m => m.Employee.JobTitleId) %>
            </td>
            <td>
                <%: Html.DropDownListFor(m => m.Employee.JobTitleId, new SelectList(Model.JobTitles, "JobTitleId", "JobTitleName"), new { @class = "TextBox" })%>
            </td>
            </tr>
            <tr>
                <td style="width: 115px">
                    <%: Html.LabelFor(m => m.Employee.StartDate) %>
                </td>
                <td>
                    <%--<%: Html.TextBoxFor(m=>m.Employee.StartDate, new{@class="SmallTextBox"}) %>--%>
                    <%= Html.DatePicker("Employee_StartDate","Employee.StartDate","") %>
                </td>
            </tr>
            <tr>
                <td style="width: 115px">
                    <%: Html.LabelFor(m => m.Employee.FinishDate) %>
                </td>
                <td>
                    <%--<%: Html.TextBoxFor(m=>m.Employee.FinishDate, new{@class="SmallTextBox"}) %>--%>
                    <%= Html.DatePicker("Employee_FinishDate","Employee.FinishDate","") %>
                </td>
            </tr>
            <tr>
                <td style="width: 115px">
                    <%: Html.LabelFor(m => m.Employee.ContractTypeId) %>
                </td>
                <td>
                    <%: Html.DropDownListFor(m => m.Employee.ContractTypeId, new SelectList(Model.ContractTypes, "ContractTypeId", "ContractTypeName"), new { @class = "TextBox" })%>
                </td>
            </tr>
            <tr>
                <td style="width: 115px">
                    <%: Html.LabelFor(m => m.Employee.MobilePhone) %>
                </td>
                <td>
                    <%: Html.TextBoxFor(m=>m.Employee.MobilePhone, new{@class="TextBox"}) %>
                </td>
            </tr>
            <tr>
                <td style="width: 115px">
                    <%: Html.LabelFor(m => m.Employee.WorkPhone) %>
                </td>
                <td>
                    <%: Html.TextBoxFor(m=>m.Employee.WorkPhone, new{@class="TextBox"}) %>
                </td>
            </tr>
            <tr>
                <td style="width: 115px">
                    <%: Html.LabelFor(m => m.Employee.WorkEmail) %>
                </td>
                <td>
                    <%: Html.TextBoxFor(m=>m.Employee.WorkEmail, new{@class="TextBox"}) %>
                </td>
            </tr>
            <tr>
                <td style="width: 115px">
                    <%: Html.LabelFor(m => m.Employee.PrivateEmail) %>
                    </td>
                <td>
                    <%: Html.TextBoxFor(m=>m.Employee.PrivateEmail, new{@class="TextBox"}) %>
                </td>
            </tr>
            <%-- <tr><td> <%: Html.LabelFor(m => m.UserName) %></td><td></td><td></td><td></td><td></td></tr>
                <tr><td> <%: Html.LabelFor(m => m.UserName) %></td><td></td><td></td><td></td><td></td></tr>--%>
    </table>
    <hr style="border-width: 1px; color: Black;" />
        <input type="submit" value="Create New Employee" class="Button" />
        <br />
        <% if (ViewData["IsCreated"] == "created") {%>
        New Employee has been created successfully, Please click <%: Html.ActionLink("[here]","Register") %> to add another employee
        <%} %>
        <% Html.EndForm(); %>
   
 
</asp:Content>
